1. Field of the Invention
The invention relates to a method for optically determining the viewing depth of a surface patch in a scene from images obtained from different viewpoints.
2. Description of the Related Art
For a number of applications it is desirable to determine the depth of surface patches that are visible in an image. Examples of such applications include systems that make it possible to compute images of the scene viewed from interactively controllable viewpoints, image compression, inspection etc. Herein, depth of a point on a surface patch refers to the distance between the viewpoint and the plane through the point and perpendicular to the optical axis of camera.
When the viewpoint of the camera is moved from a first to a second viewpoint, a depth of a surface patch can be determined from the amount of translation of the position of the image region where the surface patch is visible. If the image is obtained by point projection, the translation is proportional to the amount of displacement of the camera and inversely proportional to the depth of the surface patch.
It has been known, in order to measure the translation, to match the pixel values in a first image region in a first image obtained from the first viewpoint to the pixel values of a translated image region in a second image obtained from the second viewpoint. Matching involves determining an aggregate of the differences between the pixel values of the first image region and the pixel values in a another region. This is repeated for a number of such other regions at different positions in the second image. One of those positions is selected for which the measure of difference indicates that the aggregate of differences is minimal.
When the surface patch is small or lies in a plane perpendicular to the optical axis of the camera, the measure of difference between the pixel values of the first image region and the pixel values of the matching translated image region will indicate near perfect match. However, larger surface patches that do not lie in a plane perpendicular to the optical axis will not result in a perfect match and will tend to get segmented into smaller patches with discontinuities between the depths estimated for the smaller patches.
Amongst others, it is an object of the invention to improve the reliability and accuracy of estimates of the depth of larger surface patches that do not lie in a plane perpendicular to the optical axis of the camera.
According to the invention one searches for a combination of both depth and orientation values for the surface patch (The depth of a surface patch is for example the depth of a specified point on the surface patch). Each such combination gives rise to a particular correspondence between image points in the first and the second image. This correspondence is tested by computing an aggregate of the differences of the pixel values at corresponding points. For the best combination of depth and orientation a near perfect match will be possible also for larger surfaces that are not in a plane perpendicular to the optical axis of the camera. Hence there is no reason for segmenting these surface patches into smaller patches.
Preferably, one selects surface patches by taking predetermined regions in a first image, such as rectangular blocks of pixels. Thus no prior assumption need to be made about surface patches. For each region one selects a number of possible combinations of depth and orientation for the surface patch that is visible in that regions. Then, one determines where the pixels of that region should move if a combination of depth and orientation were correct. One determines the aggregate of the differences between the pixel content of these pixels in the first image and the pixels where they have moved to in the second image. The combination of depth and orientation which minimizes this aggregate is selected as best approximation for the depth and orientation of the surface patch visible in the region.
This is preferably applied to a grid of blocks which covers the image.
Preferably, not all combinations of depth and orientation are tried, but only combinations that are expected to be the most probable, for example combinations that have been found to be the best approximations in regions adjacent to the region for which one is trying to find the best combination of depth and orientation. Other examples of such probable combinations include combinations that have been found the most probable combination of depth and orientation by an earlier comparison of the image in the region with a further image